package com.wanghua.mall.secKill.config;

import com.wanghua.mall.secKill.interceptor.SecKillInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author wanghua
 * @create 2021-09-11 20:59
 */
@Configuration
public class SecKillWebConfig implements WebMvcConfigurer {

    @Resource
    private SecKillInterceptor secKillInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(secKillInterceptor).addPathPatterns("/**");
    }
}
